import { storeToRefs } from "pinia"
import { useGlobalStore } from "../stores/global"
//可以在当前层做逻辑处理 进行复杂的数据计算
export function useGlobal() {
    const {  theme,zIndex} = storeToRefs(useGlobalStore())
    //
    const toggleTheme=()=>{
        theme.value= theme.value=='light'?'dark':'light'
    }
    const setIndex=(val)=>{
        zIndex.value=zIndex.value=val
    }
    return {
        toggleTheme,
        setIndex
    }
}
